<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="box">
        666
    </div>
</body>
<script>
    // const s = new Set();

    // [2, 3, 5, 4, 5, 2,2,1, 2].forEach(x => s.add(x));

    // for (let i of s) {
    //     console.log(i);

    // }console.log(s.size);
    // 2 3 5 4
    // const arr = new Set(["a", "b", "c", "b"]);
    // arr.forEach(ele => {
    //     console.log(ele); // 遍历输出：a,b,c
    // });

    // map方法接受一个新参数，这个参数就是将原数组变成新数组的映射关系。
    var obj = [{
            name: '小明',
            age: 16,
            sex: '男'
        },
        {
            name: '小红',
            age: 17,
            sex: '女'
        },
        {
            name: '小白',
            age: 18,
            sex: '女'
        },
    ]
obj.forEach(item=>{
    console.log(item.name);
})
    function getter(obj) {
        obj.map(item => {
            console.log(item.age);
        })
    }

    getter(obj);
    //16
    //17
    //18
    let a=0.1;
    let b=0.2;
   a= Math.round(a*100)
   b= Math.round(b*100)
   console.log((a+b)/100);

</script>

</html>